﻿using System;

namespace Peak.Web.Controllers.FormsAuthentication
{
  public class FormsAuthenticationService : IFormsAuthenticationService
  {
    public void SignIn(string userName, bool createPersistentCookie)
    {
      if (String.IsNullOrEmpty(userName)) throw new ArgumentException("Value cannot be null or empty.", "userName");

      System.Web.Security.FormsAuthentication.SetAuthCookie(userName, createPersistentCookie);
    }

    public void SignOut()
    {
      System.Web.Security.FormsAuthentication.SignOut();
    }
  }
}
